package com.zhuang.designpattern.memento;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * description: ConfigOriginator
 * date: 2022/9/19 16:13
 * author: Zhuang
 * version: 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ConfigOriginator {
    private ConfigFile configFile;

    //保存备忘录的时候会创建一个备忘录信息，并返回去，交给管理者处理
    public ConfigMemento saveMemento() {
        return new ConfigMemento(configFile);
    }


    public void getMemento(ConfigMemento memento){ this.configFile = memento.getConfigFile();
    }

}
